home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / TOUCHLIN.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  56 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef touchline
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_touchlin = "$Header: c:/curses/portable/RCS/touchlin.c%v 2.0 1992/11/15 03:29:18 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12.  
  13. /*man-start*********************************************************************
  14.  
  15.   touchline()  - touch line in window
  16.  
  17.   PDCurses Description:
  18.        Similar to touchwin(), but less drastic.
  19.  
  20.        Throw away all optimisation information about which parts of the
  21.        window (well, lines) have been touched, by pretending that the
  22.        entire line(s) has been drawn on.
  23.  
  24.   PDCurses Errors:
  25.        The touchline() function returns OK on success and ERR on error.
  26.  
  27.        It is an error to pass a NULL window.
  28.  
  29.        It is also an error to specify a line outside the boundaries of
  30.        the passed window or if the start line plus the number of lines
  31.        exceeds the boundary of the window.
  32.  
  33.   Portability:
  34.        PDCurses        
  35.        SysV Curses     
  36.        BSD Curses      
  37.  
  38. **man-end**********************************************************************/
  39.  
  40. int    touchline(WINDOW *w, int start,int num)
  41. {
  42.        register int i;
  43.  
  44.        if (w == (WINDOW *)NULL)
  45.                return( ERR );
  46.  
  47.        if  (start > w->_maxy || start + num > w->_maxy)
  48.                return( ERR );
  49.        for(i=start;i<start+num;i++)
  50.           {
  51.                w->_firstch[i] = 0;
  52.                w->_lastch[i] = w->_maxx - 1;
  53.           }
  54.        return( OK );
  55. }
  56.